# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/boost/boost-1.34.1-r1.ebuild,v 1.2 2008/01/20 07:33:20 vapier Exp $

inherit distutils flag-o-matic multilib toolchain-funcs versionator check-reqs subversion

KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"

DATE="2008-02-04"
MY_P="boost-posix-${DATE}"

DESCRIPTION="Boost Libraries for C++"
HOMEPAGE="http://www.boost.org/"
SRC_URI="http://boost.cowic.de/rc/boost-posix-${DATE}.tar.gz"

#ESVN_REPO_URI="http://svn.boost.org/svn/boost/trunk"
#ESVN_PROJECT="boost"
LICENSE="freedist Boost-1.0"
SLOT="0"
#IUSE="debug doc icu pyste tools"

DEPEND="icu? ( >=dev-libs/icu-3.2 )
		sys-libs/zlib
		dev-util/boost-build"
RDEPEND="${DEPEND}
		pyste? ( dev-cpp/gccxml dev-python/elementtree )"

S=${WORKDIR}/${MY_P}

# Maintainer Information
# ToDo:
# - write a patch to support /dev/urandom on FreeBSD and OSX (see below)

pkg_setup() {
	if has test ${FEATURES} ; then
		CHECKREQS_DISK_BUILD="1024"
		check_reqs

		ewarn "The tests may take several hours on a recent machine"
		ewarn "but they will not fail (unless something weird happens ;-)"
		ewarn "This is because the tests depend on the used compiler/-version"
		ewarn "and the platform and upstream says that this is normal."
		ewarn "If you are interested in the results, please take a look at the"
		ewarn "generated results page:"
		ewarn "  ${ROOT}usr/share/doc/${PF}/status/cs-$(uname).html"
		ebeep 5

	fi
}

src_unpack() {
	unpack ${A}
#	subversion_src_unpack

#	EPATCH_SOURCE="${WORKDIR}/patches"
#	EPATCH_SUFFIX="patch"
#	epatch


}

src_compile() {

	./configure --prefix=${D}/usr --libdir=${D}/usr/$(get_libdir)  --includedir=${D}/usr/include

	emake

	if use pyste; then
		cd "${S}/libs/python/pyste/install"
		distutils_src_compile
	fi

}

src_install() {
	emake install
	mv "${D}/usr/include/boost-1_35/boost" "${D}/usr/include"
	rm -r "${D}/usr/include/boost-1_35"

	cd "${D}/usr/$(get_libdir)"
	for i in libboost_*gcc43.so; do ln -s $i $(echo $i | sed s/-gcc43//); done
	for i in libboost_*gcc43-mt.so; do ln -s $i $(echo $i | sed s/-gcc43//); done
}
